#!/bin/bash

load_image() {
  cd /tmp
  curl -O http://nas.liufq.cn:9090/sloth-bear/nginx.tar
  docker load -i nginx.tar
}

opt_path='/Volumes/nas/opt'
opt_path='/tmp/zfsv2/zenith_sata/18667191781/data/docker'

mkdir ${opt_path}/nginx
cp nginx.conf ${opt_path}/

docker rm -f nginx
docker run -d --name nginx --restart=always --network=host \
  -v /opt/nginx/nginx.conf:/etc/nginx/conf.d/default.conf \
  -v /etc/letsencrypt/live/nas.liufq.cn/privkey.pem:/etc/letsencrypt/live/nas.liufq.cn/privkey.pem \
  -v /etc/letsencrypt/live/nas.liufq.cn/fullchain.pem:/etc/letsencrypt/live/nas.liufq.cn/fullchain.pem \
  nginx:latest

sudo docker logs -f nginx